package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiL2VpnPwProtectMapper;
import com.ruoyi.net.domain.BusiL2VpnPwProtect;
import com.ruoyi.net.service.IBusiL2VpnPwProtectService;

/**
 * 业务-L2 VPN配置-pw保护对Service业务层处理
 * 
 * @author net
 * @date 2024-12-14
 */
@Service
public class BusiL2VpnPwProtectServiceImpl implements IBusiL2VpnPwProtectService 
{
    @Autowired
    private BusiL2VpnPwProtectMapper busiL2VpnPwProtectMapper;

    /**
     * 查询业务-L2 VPN配置-pw保护对
     * 
     * @param id 业务-L2 VPN配置-pw保护对主键
     * @return 业务-L2 VPN配置-pw保护对
     */
    @Override
    public BusiL2VpnPwProtect selectBusiL2VpnPwProtectById(String id)
    {
        return busiL2VpnPwProtectMapper.selectBusiL2VpnPwProtectById(id);
    }

    /**
     * 查询业务-L2 VPN配置-pw保护对列表
     * 
     * @param busiL2VpnPwProtect 业务-L2 VPN配置-pw保护对
     * @return 业务-L2 VPN配置-pw保护对
     */
    @Override
    public List<BusiL2VpnPwProtect> selectBusiL2VpnPwProtectList(BusiL2VpnPwProtect busiL2VpnPwProtect)
    {
        return busiL2VpnPwProtectMapper.selectBusiL2VpnPwProtectList(busiL2VpnPwProtect);
    }

    /**
     * 新增业务-L2 VPN配置-pw保护对
     * 
     * @param busiL2VpnPwProtect 业务-L2 VPN配置-pw保护对
     * @return 结果
     */
    @Override
    public int insertBusiL2VpnPwProtect(BusiL2VpnPwProtect busiL2VpnPwProtect)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiL2VpnPwProtect.getId())) {
            busiL2VpnPwProtect.setId(uuid);
        }
        busiL2VpnPwProtect.setCreateBy(SecurityUtils.getUsername());
        busiL2VpnPwProtect.setCreateTime(DateUtils.getNowDate());
        busiL2VpnPwProtect.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnPwProtect.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnPwProtectMapper.insertBusiL2VpnPwProtect(busiL2VpnPwProtect);
    }

    /**
     * 修改业务-L2 VPN配置-pw保护对
     * 
     * @param busiL2VpnPwProtect 业务-L2 VPN配置-pw保护对
     * @return 结果
     */
    @Override
    public int updateBusiL2VpnPwProtect(BusiL2VpnPwProtect busiL2VpnPwProtect)
    {
        busiL2VpnPwProtect.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnPwProtect.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnPwProtectMapper.updateBusiL2VpnPwProtect(busiL2VpnPwProtect);
    }

    /**
     * 批量删除业务-L2 VPN配置-pw保护对
     * 
     * @param ids 需要删除的业务-L2 VPN配置-pw保护对主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnPwProtectByIds(String[] ids)
    {
        return busiL2VpnPwProtectMapper.deleteBusiL2VpnPwProtectByIds(ids);
    }

    /**
     * 删除业务-L2 VPN配置-pw保护对信息
     * 
     * @param id 业务-L2 VPN配置-pw保护对主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnPwProtectById(String id)
    {
        return busiL2VpnPwProtectMapper.deleteBusiL2VpnPwProtectById(id);
    }
}
